﻿<%@ Page Title="" Language="C#" MasterPageFile="~/RightFrame.Master" AutoEventWireup="true" CodeBehind="RoleManage.aspx.cs" Inherits="MyOA.UI.SysManage.RoleManage.RoleManage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphTitle" runat="server">
 你的位置：角色管理
   <script type="text/javascript">
       var Alert=ymPrompt.alert;
        var Error=ymPrompt.errorInfo;
        var roleName;
         function aHref()
        {
           
            document.location.href="RoleManage.aspx";
        }
        function btnClick()
        {
            roleName=document.getElementById("<%=txtRoleName.ClientID %>");
            if(roleName.value=="")
            {
                Error("角色名不能为空",null,null,"温馨提示",nameFocus);
                return false;
            }
            return true;
        }
        
        
        function nameFocus()
        {
            
            roleName.value="";
            
            roleName.focus();
            
        }
        
        function aclick()
        {
            document.getElementById("<%=txtRoleName.ClientID %>").value="";
            document.getElementById("<%=txtRoleName.ClientID %>").focus();
            document.getElementById("<%=btnSave.ClientID %>").disabled=false;
            document.getElementById("<%=btnUpdate.ClientID %>").disabled=true;
            
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphContnent" runat="server">
    <div class="body_title">角&nbsp;&nbsp;色&nbsp;&nbsp;管&nbsp;&nbsp;理</div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
     <div class="body_content" style="margin-left:120px;">
        角色名称：
        <div style=" margin-bottom:10px; ">
            <asp:TextBox ID="txtRoleName" runat="server" CssClass="inputText"></asp:TextBox>
        </div>
        
        <div>
               <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="btn" 
                onMouseOver="document.getElementById(this.id).className='btnOver'" 
                   onMouseOut="document.getElementById(this.id).className='btnOut'" onclick="btnSave_Click"
                     OnClientClick="return btnClick()"
                 />
                 
                
                <span style=" margin-left:-20px;"> 
                     <asp:Button ID="btnUpdate" runat="server" Text="修改" CssClass="btn" 
                    onMouseOver="document.getElementById(this.id).className='btnOver'" onMouseOut="document.getElementById(this.id).className='btnOut'"
                     OnClientClick="return btnClick()" onclick="btnUpdate_Click"/>
                 </span>
                 
                 <a href="#" onclick="aclick()">新增</a>
        </div>
        
        <div style="margin-top:20px;">
            <table cellpadding="0" cellspacing="1" bgcolor="#CECECE" width="80%">
                <asp:Repeater ID="rpRole" runat="server">
                
                 <HeaderTemplate>
                    <tr style="margin:0px; text-align:center;" height="26">
                        <td height="26" background="../../images/tab_14.gif" >角色名称</td>
                        <td  background="../../images/tab_14.gif" >修改</td>
                        <td background="../../images/tab_14.gif" >删除</td>
                        <td  background="../../images/tab_14.gif" >分配角色权限</td>
                </tr>
            </HeaderTemplate>
            
            <ItemTemplate>
                 <tr onmousemove="this.style.backgroundColor='white';" onmouseout="this.style.backgroundColor='#66CCFF'" bgcolor="#66CCFF" style="margin:0px; text-align:center;" height="26">
                    <td width="25%"><%#Eval("rolename") %></td>
                    <td width="25%"><asp:ImageButton ID="imgbtnUpdate" runat="server" ImageUrl="~/images/edit.gif"  OnClick="ImageUpdate_Click" CommandName='<%#Eval("roleid") %>' CommandArgument='<%#Eval("rolename") %>' /></td>
                    <td width="25%"> <asp:ImageButton ID="imgbtnDelete" ImageUrl="~/images/delete.gif"  runat="server"  OnClientClick="return confirm('确实要删除角色吗？')" CommandName='<%#Eval("roleid") %>' OnClick="ImageDelete_Click"/></td>
                    <td width="25%"><a href='<%# "DistributeRole.aspx?roleId="+Eval("roleid")+"&roleName="+Server.UrlEncode(Eval("rolename").ToString())%>'>分配权限</a></td>
                    
                    
                </tr>
            </ItemTemplate>
                </asp:Repeater>
            
                
            
            </table>
        </div>
     </div>
        <asp:HiddenField ID="hfdRoleId" runat="server" />
     </ContentTemplate></asp:UpdatePanel>
</asp:Content>
